<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" type="text/css" href="../../js/lib/theme-chalk/index.css" />
		<link rel="stylesheet" type="text/css" href="../../css/myCustomer.css" />
		<link rel="stylesheet" type="text/css" href="../../css/my_commont.css" />
		<link rel="stylesheet" type="text/css" href="index.css" />

		<script src="../../common/utilCookie.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../common/author.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<!-- 引入组件库 -->
		<script src="../../js/lib/index.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/axios.min.js"></script>
		<script src="../../common/judegetEmpty.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/aixos-init.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/config.js" type="text/javascript" charset="utf-8"></script>
		<script src="index.js" type="text/javascript" charset="utf-8"></script>
            <style type="text/css">
			[v-cloak] {
				display: none;
			}
		</style>
	</head>
	<body>
		<div id="shopGoodTypeApp" v-cloak>
			<div class="contaner" v-loading.fullscreen.lock="fullscreenLoading">
				<div class="section-header">
					商品 - -商品分类
				</div>
				<hr class="hr-style" />
				<div class="my_height_20">
					<el-button @click="addPlartFristCategory"> 添加一级分类</button>
				</div>
				<div class="shop-good-type-tab">
					<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
						<el-tab-pane label="平台商品分类" name="first">
							<div class="shop-good-platform-list">
								<el-table :data="shopGoodPlatformData" border style="width: 100%">

									<el-table-column label="级(-级别)" align="center" width="130">
										<template slot-scope="scope">
											<div class="good-setting-ico">

												<el-dropdown size="mini" placement="bottom" @command="handlePlatformCommand">
													<span class="el-dropdown-link">
														<i class="el-icon-setting"></i>
														设置
														<i class="el-icon-arrow-down el-icon--right"></i>
													</span>
													<el-dropdown-menu slot="dropdown">
														<el-dropdown-item :command="beforeHandleCommand(scope.row,'a')">添加二级分类</el-dropdown-item>
														<el-dropdown-item :command="beforeHandleCommand(scope.row,'b')">查看二级分类</el-dropdown-item>
													</el-dropdown-menu>
												</el-dropdown>
											</div>

										</template>
									</el-table-column>
									<el-table-column prop="name"  label="分类名称">
									</el-table-column>
									<el-table-column prop="showOrder"  label="权重">
									</el-table-column>
									<el-table-column  label="分类图片">
									   <template slot-scope="scope">
										   <el-image :src="scope.row.photo" class="img_style"></el-image>
									   </template>
									</el-table-column>
									
									<el-table-column  label="设置">
									   <template slot-scope="scope">
										 <el-button  @click="editGoodType(scope.row)"> 修改商品分类</el-button>
									   </template>
									</el-table-column>
									
								</el-table>
							</div>
						</el-tab-pane>
					</el-tabs>
				</div>
				<el-dialog :title="title" :visible.sync="dialogFormVisible" width="400px">
					<el-form :model="form">
						<el-form-item label="分类名称" :label-width="formLabelWidth">
							<el-input v-model="form.name" autocomplete="off"></el-input>
						</el-form-item>
                         <el-form-item label="分类图片" :label-width="formLabelWidth">
                         	<el-upload ref="coverUpload" :action='uploadUrl' :before-remove="beforeCourseRemove" :file-list="carouseImgUrl"
                         	 :on-success="handleCoverSuccess" list-type="picture" :limit='1' :on-exceed="handleCoverExceed">
                         		<el-button slot="trigger" size="small" type="primary"><i class="el-icon-upload el-icon--right"></i>&nbsp;选取图片</el-button>
                         	</el-upload>
                         </el-form-item>
						<el-form-item label="分类权重" :label-width="formLabelWidth">
							<el-input  v-model.number="form.showOrder" autocomplete="off"></el-input>
						</el-form-item>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="dialogFormVisible = false">取 消</el-button>
						<el-button type="primary" @click="configUpload">确 定</el-button>
					</div>
				</el-dialog>
                
				<el-dialog title="修改一级分类" :visible.sync="dialogEditFormVisible" width="400px">
					<el-form :model="editFrom">
						<el-form-item label="分类名称" :label-width="formLabelWidth">
							<el-input v-model="editFrom.name" ></el-input>
						</el-form-item>
				         <el-form-item label="分类图片" :label-width="formLabelWidth">
				         	<el-upload ref="coverUpload" :action='uploadUrl' :before-remove="beforeCourseRemove" :file-list="carouseImgUrl"
				         	 :on-success="handleCoverSuccess" list-type="picture" :limit='1' :on-exceed="handleCoverExceed">
				         		<el-button slot="trigger" size="small" type="primary"><i class="el-icon-upload el-icon--right"></i>&nbsp;选取图片</el-button>
				         	</el-upload>
				         </el-form-item>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="dialogEditFormVisible = false">取 消</el-button>
						<el-button type="primary" @click="configEditUpload">确 定</el-button>
					</div>
				</el-dialog>  
				

			</div>
		</div>
	</body>
</html>
